Re: [INTERFACES] Determine data type of columns - Mailing list pgsql-interfaces

From Herouth Maoz
Subject Re: [INTERFACES] Determine data type of columns
Date
Msg-id l03110701b26f0f0c4c43@[147.233.159.109]
Whole thread Raw
In response to Determine data type of columns  ("Bryan White" <bryan@arcamax.com>)
List pgsql-interfaces
At 23:21 +0200 on 10/11/98, Bryan White wrote:


> I have a general purpose utilty for entering data into web based forms.  The
> function that parses the data and inserts the record into a table is largely
> unaware of the structure of the table it is operating on.  I am currenly
> having problems with integer fields.  If I blindly quote all fields the back
> end will complain about casting on integer fields.  Also I would like to do
> some primitive field validation based on type before submitting to the back
> end.

It may be worth noticing that if you use COPY rather than INSERT, you don't
have to quote neither numbers nor other data types. You do have to quote
delimiter characters (tab, newline, backslash - or whatever you chose as
your copy delimiters) with a backslash. That can be easily done even with
the most "blind" front end, which knows nothing about the fields.

I know, I know. You want to do updates and some type-based data checking as
well. But this may be the answer in cases you don't, and be faster at that.

Herouth

--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma



pgsql-interfaces by date:

Previous
From: Herouth Maoz
Date:
Subject: Re: [INTERFACES] how to obtain column info
Next
From: "Gene Selkov Jr."
Date:
Subject: Re: [INTERFACES] need information about storing methods